<section class="content">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">询价列表</h3>
                    <div class="card-tools">
                        <div class="input-group input-group-sm" style="width: 150px;">
                            <input type="hidden" name="s" value="<?php echo MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME; ?>"/>
                            <input type="text" name="keywords" class="form-control float-right" placeholder="请输入关键字">
                            <div class="input-group-append">
                                <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card-body">
                    <table id="example2" class="table table-bordered table-hover">
                        <thead>
                            <tr>
                                <th width="100" >ID</th>
                                <th>订单号</th>
                                <th>所属用户</th>
                                <th>客户名称</th>
                                <th>所在公司</th>
                                <th>客户电话</th>
                                <th width="15%">创建时间</th>
                                <th width="20%">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name="list" item="v">
                            <tr>
                                <td >{$v.id}</td>
                                <td>{$v.order_no|replace_keywords=I('get.keywords'),###}</td>
                                <td>{$v.uid|get_user_info=###,'username'|replace_keywords=I('get.keywords'),###} - {$v.uid|get_user_info=###,'nickname'|replace_keywords=I('get.keywords'),###}</td>
                                <td>{$v.name|replace_keywords=I('get.keywords'),###}</td>
                                <td>{$v.composer|replace_keywords=I('get.keywords'),###}</td>
                                <td>{$v.phone|replace_keywords=I('get.keywords'),###}</td>
                                <td>{$v.md_time|date="Y-m-d H:i:s",###}</td>
                                <td>
                                    <div class="button-group">
                                        <a class="btn" href="{:U('xun_edit',array('id'=>$v['id']))}"><i class="fa fa-edit"></i>回复</a> 
                                        <a class="btn" href="javascript:void(0)" onclick="return del('{:U('xun_hl',array('id'=>$v['id']))}')"><i class="fa fa-trash-o fa-lg"></i>忽略</a>
                                    </div>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
                <div class="card-footer clearfix">
                    {$page}
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
    function del(url) {
        method.msg_layer({
            type:"layer-spread",
            title:"您确定要忽略吗?",
            content:"<div>您确定要忽略本条内容吗？一旦忽略将不再可见,需要联系数据管理员进行回复才行。</div>",
            area:["300px","auto"],
            btn:["取消","提交"],
            btn_yes:function(){
                $.get(url,function(d){
                    if(d.status == 0){
                        var obj={
                            type:"layer-shake",
                            title:"结果",
                            content:"<div>" + d.info + '</div>',
                            area:["300px","auto"]
                        };
                        method.msg_layer(obj);
                    } else {
                        var obj={
                            type:"layer-spread",
                            title:"结果",
                            content:"<div>" + d.info + '</div>',
                            area:["300px","auto"]
                        };
                        method.msg_layer(obj);
                        setTimeout(function(){
                            window.location.href = d.url;
                        },800)
                    }
                });
            }
        });
    }
</script>